package com.snake.springboot.custom.api.model.points;


import com.snake.springboot.custom.api.model.common.KeyVal;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>算力变动类型
 * 类{@code PointsChangeType} </br>
 * 创建时间2025/2/21 17:56
 * @author yangxt
 * @see
 */
public enum PointsChangeType {
//    ADD(0,"增加"),
//    REDUCE(1,"减少"),
    RECHARGE(2,"充值"),
    RET(3,"退单"),
    EXCHANGE(4,"兑换"),
    EXPIRE(5,"过期"),
    CONSUME(6,"消费"),
    SYS_ADD(7,"系统增加"),
    SYS_REDUCE(8,"系统扣减"),
    OTHER(9,"其他");


    private Integer changeType;

    private String msg;

    PointsChangeType(Integer changeType, String msg) {
        this.changeType = changeType;
        this.msg = msg;
    }
    public static List<KeyVal<Integer,String>> getEnumList(){
        List<KeyVal<Integer,String>>  kv=new ArrayList<>(4);
        PointsChangeType[] values = PointsChangeType.values();
        for (PointsChangeType typeEnum:values) {
            kv.add(new KeyVal<>(typeEnum.getChangeType(),typeEnum.getMsg()));
        }
        return kv;
    }


    public Integer getChangeType() {
        return changeType;
    }

    public void setChangeType(Integer changeType) {
        this.changeType = changeType;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
